<?php
/** 
* @file theme.php
* @brief 
* @author Henry.WU, henry.cpp@gmail.com
* @version 0.1
* @date 2010-02-25
 */

require_once( ROOT . 'libary/smarty/libs/Smarty.class.php');

class Theme
{
  private $smarty = NULL;

  public function Theme()
  {
    $template_name = 'default';
    $this->smarty=new Smarty;           //初始化Smarty
    $this->smarty->compile_check = true;      //打开模版编译检查
    $this->smarty->debugging = false;       //关闭调试
    $this->smarty->caching = false;       //关闭缓存
    $this->smarty->template_dir = "template/{$template_name}/"; //设置模版路径
    $this->smarty->compile_dir = 'template_c';  //设置编译文件存放的文件夹

  }

  public function assign( $tpl_var, $value = null, $nocache = false, $scope = SMARTY_LOCAL_SCOPE )
  {
    return $this->smarty->assign( $tpl_var, $value, $nocache, $scope );
  }

  public function display( $template, $cache_id = null, $compile_id = null, $parent = null )
  {
    return $this->smarty->display( $template, $cache_id, $compile_id, $parent );
  }

}

?>
